package navigation;

import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.webapp.WebAppContext;

import java.net.InetSocketAddress;

/**
 * Created with IntelliJ IDEA.
 * User: James.Owen
 * Date: 08/12/13
 * Time: 15:12
 * To change this template use File | Settings | File Templates.
 */

public class JazzyWebServer
{
    public static void main(String[] args) throws Exception {
        Server server = new Server(Integer.valueOf(System.getenv("PORT")));
        WebAppContext webapp = new WebAppContext();
        webapp.getInitParams().put("org.eclipse.jetty.servlet.Default.useFileMappedBuffer", "false");
        webapp.setContextPath("/");
        webapp.setResourceBase("./src/main/resources");
        webapp.setDescriptor("src/main/webapp/WEB-INF/web.xml");
        server.setHandler(webapp);
        server.start();
        server.join();
    }
}

